﻿@model XPressify.Models.CommentsListModel
@using XPressify.Models

<table border="0" cellpadding="0" cellspacing="0" style="margin:0px;padding:0px;width:553px">
    <tr>
        <th style="width:46px"></th>
        <th width="0px" style="padding: 0px 2px 0px 2px"> 
            @Model.Created.ToString("dd MMMM, yyyy a't' HH:mm") *
            @(Ajax.ActionLink("Like/Unlike", "PostLike", "Post", new { id = Model.PostDummy.Id }, new AjaxOptions { UpdateTargetId = Model.PostDummy.Id.ToString(), OnSuccess = "", InsertionMode = System.Web.Mvc.Ajax.InsertionMode.InsertBefore, HttpMethod = "GET" }, new { @class = "nobtn" })) 
            *
            @(Ajax.ActionLink("People like this", "PostLikeList", "Post", new { id = Model.PostDummy.Id }, new AjaxOptions { UpdateTargetId = "specialPeopleLikeList", OnSuccess = "peopleLikeListSuccess", InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace, HttpMethod = "GET" }, new { @class = "nobtn" }))
            
            @*@Html.ActionLink("Like/Unlike", "PostLike", "Post", new { id = Model.PostDummy.Id }, new { @class = "nobtn", style = "font: 13px 'Trebuchet MS', Verdana, Helvetica, sans-serif;" })
            *
            @Html.ActionLink("People like this", "PostLikeList", "Post", new { id = Model.PostDummy.Id }, new { @class = "nobtn", style = "font: 13px 'Trebuchet MS', Verdana, Helvetica, sans-serif;" })*@
        </th>
    </tr>
</table>

@{var specialUpdateId = "";}
@foreach (var comment in Model.Comments)
{   
    <div id="@comment.Id">        
        <table border="0" cellpadding="0" cellspacing="0" style="margin:0px;padding:0px;width:553px">
            <tr>
                <th width="0px" style="padding: 0px 2px 0px 2px"> 
                    @Html.Raw(comment.Content)
                </th>
                @if (comment.BaseSubject.Id == Model.CurrentUserId || Model.IsOwner)
                {
                    <th style="padding: 0px 2px 0px 2px;vertical-align: top;text-align:right"> 
                        @Html.Partial("BtnPostCommentDelete", new BtnPostDeleteModel { PostId = comment.Id})
                        @*@Html.ActionLink("x", "PostCommentDelete", "Post", new { id = comment.Id }, new { @class = "nobtn", style = "font: 13px 'Trebuchet MS', Verdana, Helvetica, sans-serif;" })*@
                    </th>
                }
            </tr>
        </table>
    </div>
}

@{specialUpdateId = Model.PostDummy.Id + "Update";}
<div id="@specialUpdateId"></div>

@Html.Partial("WriteComment", new XPressify.Models.PostCommentModel { PostId = Model.PostDummy.Id, ContentText = "Write a comment...", ProfilePicturePath = Model.ProfilePicturePath })
